#输出99乘法表
#raw 为行，col为列 以for ...in格式输出

for raw in range(1,10):
    for col in range(1,raw+1):
        print('{}*{}={:<4}'.format(raw,col,raw*col),end='')
    print(' ')
print(' '*80)
print('='*80)


for raw in range(9,0,-1):
    for col in range(1,raw+1):
        print('{}*{}={:<4}'.format(raw,col,raw*col),end='')
    print(' ')
print(' '*80)
print('='*80)



for i in range(1, 10):  
    for k in range(1, i):
        print(end=" "*7)  # 7位
    for j in range(i, 10):
        print("%d*%d=%2d" % (j, i, i*j), end=" ")
    print("")
print(' '*80)
print('='*80)


for raw in range(9,0,-1):
    for col in range(1,raw):
        print(end =' '*7)
    for j in range(raw,10):
        print("%d*%d=%2d" % (raw,j,j*raw),end=' ')
    print(' ')
print(' '*80)
print('='*80)

#while 循环

j=1
while j<=9:
    i=1a
    while i<=j:
        print('{}*{}={:<4}'.format(i,j,i*j),end=' ')
        i+=1
    print('')
    j+=1
print(' '*80)
print('='*80)


